const p1 = new Promise((resolve, reject) => {
	setTimeout(() => {
		resolve('hello p1')
		reject('p1 reject')
	}, 3000)
})

const p2 = new Promise((resolve, reject) => {
	setTimeout(() => {
		resolve(p1)
	}, 1000)
})

console.time('p2')
p2.then(res => {
	console.log('ok', res)
	console.timeEnd('p2')
}, res => {
	console.warn('error', res)
	console.timeEnd('p2')
})
